package com.chenyun.mq.rabbitmq.handler;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.core.RabbitTemplate;

/**
 * @author: lonni
 * @CreateTime: 2023-12-02  16:52
 * @Description:
 */
public class DefaultReturnsCallback implements RabbitTemplate.ReturnCallback {
    @Override
    public void returnedMessage(Message message, int replyCode, String replyText, String exchange, String routingKey) {
        System.out.println("\n确认消息送到队列(Queue)结果：");
        System.out.println("发生消息：" + new String(message.getBody()));
        System.out.println("回应码：" + replyCode);
        System.out.println("回应信息：" + replyText);
        System.out.println("交换机：" + exchange);
        System.out.println("路由键：" + routingKey);
    }
}